# 修复ActivityMapper接口中缺少selectActivityOptions方法的问题
# 此脚本会将scms-secondclass模块中的ActivityMapper.java文件复制到scms-admin模块中

Write-Host "===== 修复ActivityMapper接口 ====="
Write-Host "此脚本将修复ActivityMapper接口中缺少selectActivityOptions方法的问题"

# 检查源文件是否存在
$sourceFile = "./scms-secondclass/src/main/java/com/scms/secondclass/mapper/ActivityMapper.java"
if (-not (Test-Path $sourceFile)) {
    Write-Host "错误: 源文件 $sourceFile 不存在！" -ForegroundColor Red
    exit 1
}

# 创建目标目录
$targetDir = "./scms-admin/src/main/java/com/scms/secondclass/mapper"
if (-not (Test-Path $targetDir)) {
    Write-Host "创建目标目录: $targetDir"
    New-Item -Path $targetDir -ItemType Directory -Force | Out-Null
}

# 复制文件
$targetFile = "$targetDir/ActivityMapper.java"
Write-Host "复制文件: $sourceFile -> $targetFile"
Copy-Item -Path $sourceFile -Destination $targetFile -Force

Write-Host "文件复制完成！"

# 清理和重新编译项目
Write-Host "清理和重新编译项目..."
mvn clean compile

Write-Host "修复完成！请重启系统以应用更改。" 